home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D Speech Pack / 4D Speech Pack.rsrc / TEXT_11012_†SP Voice code.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  3.2 KB  |  68 lines

  1. SP Voice code (reference; line; phoneme; flags) -> err
  2.  
  3. reference   integer       specifys the channel you want to close. Use the
  4.                                     reference number obtained from the
  5.                                    SP Open Voice function.
  6. line            string (255) is a string (max. length 255) which contains the
  7.                                    text you want to convert. It can also contain a
  8.                                     reference to a "STR#‚Äú resource.
  9. phoneme     string (255) returns the text passed in the ‚Äùline‚Äú
  10.                                     parameter as phoneme code.
  11. flags           integer      which indicates if the embedded speech
  12.                                    commands should be included automatically.
  13.                    0  phoneme code without embedded commands
  14.                    1  phoneme code with embedded commands
  15.                    (other values may be defined with later versions of Speech
  16.                    Pack, but the currently defined set will always be
  17.                    compatible)
  18. err             integer       returns the error which occured. 
  19.                                     A value of zero indicates no error occured. See 
  20.                                     below for a list of possible errors.
  21.  
  22. Converts the string you pass using the speech synthesizer of the speech channel you specify into raw phoneme code.
  23.  
  24. Since the ‚Äùphoneme‚Äú parameter will contain up to four times more characters than you put into the ‚Äúline‚Äù parameter you can't pass the maximum number of characters in the ‚Äùline‚Äú parameter.
  25. Converting and storing the string beforehand saves memory and time when you use the phoneme code later with SP Voice String or SP Speak String. When the phoneme parameter contains the embedded speech commands you can pass it directly to these two functions.
  26.  
  27. If you create your own dictionairy of words and their correct phoneme equivalent, email them to me and perhaps I can add them to the dictionary resource.
  28.  
  29. Example:
  30.   `the string you want to say at startup:
  31.   $line := "Welcome to the Speech Manager"
  32.  
  33.   `convert it to phoneme code:
  34.   $err := SP Voice code ($speechref;$line;$phoneme,1)
  35.  
  36.   `$phoneme now contains (American English):
  37.   `"[[inpt PHON]]_w1EHlkUXm~t2UH~D2UX_sp1IYC_
  38.      m1AEnAXJ2AXr[[inpt TEXT]]"
  39.  
  40.   `store it in your prefs file for use at the next startup
  41.   `if an error occured just store the normal line
  42.   If ($err = 0)
  43.     [Prefs]welcome := $phoneme
  44.   Else
  45.     [Prefs]welcome := $line
  46.   End If
  47.  
  48.   `and later:
  49.   $err := SP Voice String ($speechref;[Prefs]welcome)
  50.  
  51. Possible errors:
  52.         0  No Error
  53.       -4  Speech Pack can not be used (Speech Mgr not available)
  54.     -50  Parameter error (inside external, not necessarily the
  55.             parameters you pass)
  56.   -108  Not enough memory to load voice into memory
  57.   -109  Internal handle contains nil value
  58.   -111  Tried to dispose an already disposed non-relocatable block
  59.   -192  String resource not found or empty
  60.   -231  Feature not implemented on synthesizer
  61.   -243  Output buffer is too small to hold result
  62.             (the ‚Äùline‚Äú parameter holds too many characters)
  63. -3000  Invalid SpeechChannel parameter, probably invalid reference
  64.             number
  65.  
  66.  
  67.  
  68.